$(function(){
	//获取地址中的参数，判断显示一级好友还是二级好友
	
	// 取出前一个界面传过来的参数  
	function GetRequest() {        
	    var url = location.search;   
	    var theRequest = new Object();        
	    if (url.indexOf("?") != -1) {         
	        var str = url.substr(1);           
	        strs = str.split("&");         
	        for(var i = 0; i < strs.length; i++) {          
	            theRequest[strs[i].split("=")[0]]=decodeURI(strs[i].split("=")[1]);         
	        }          
	    }         
	    return theRequest;        
	}
	
	getFridentList();
	function getFridentList(){
		$.ajax({
			type:'GET',
			url:'http://a.91jfk.com/Product/User/friend_list',
			dataType:'json',
			success:function(res){
				console.log(res);
				if (res.code == 1) {
					var msg = res.list;
					for (var i = 0;i < msg.length;i++) {
						if (msg[i].path.substring(0,1) == GetRequest().id) {
							isShow(msg[i].tel,msg[i].last_time,msg[i].lv);
						}
					}
				}
			},
			error:function(err){
				console.log(err);
			}
		});
	}
	//数据显示的方法
	function isShow(telNum,time,level){
		var frident_listUl = $('.frident_list');
		var Info_listLi = $('<li class="Info_list"><p class="telNum">' + telNum + '</p><p class="enrollTime">'+ time +'</p><p class="grade">'+ level +'</p></li>');
		frident_listUl.append(Info_listLi);
	}
});
